package tech.aistar.controller;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import tech.aistar.pojo.Comment;

import tech.aistar.service.CommentService;

import tech.aistar.vo.Result;

import java.util.List;

@RestController
@RequestMapping("user")
public class CommentController {

    @Autowired
    private CommentService commentService;

    @PostMapping("comment")
    public Result findAll() {

        List<Comment> comment = commentService.findAll();

        System.out.println("11111");
        return new Result("200", "查询成功", comment);

    }

    @PostMapping("insert")
    public Result insert(@RequestBody Comment comment) {

        commentService.insert(comment);

        System.out.println("222222222");
        return new Result("200", "增加成功", comment);
    }
}
